home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / msdl / readme.txt < prev   
Text File  |  1993-12-21  |  8KB  |  206 lines

  1. ANNOUNCE : A 3 dimensional scene description language & parser for computer
  2.            graphics.
  3.  
  4. This is an announcement of the availability of a language and parser for use
  5. in computer graphics for the representation of 3 dimensional scenes. The 
  6. language has been developed at the University of Manchester for use in
  7. graphics research. 
  8.  
  9. The language was developed for our own internal use, but now that it has
  10. reached a certain stage of maturity we felt it may be of use to others. 
  11. Consequently the parser, documentation, and several sample scenes have been
  12. made available through our anonymous ftp site.
  13.  
  14. The rest of this document outlines the language, and how a graphics researcher
  15. might use it in his or her own application. Further information on the
  16. language, together with some of the work it has been used for, is
  17. available from the WWW page at http://info.mcc.ac.uk/CGU/MSDL/MSDL-intro.html.
  18.  
  19. The Manchester Scene Description Language (MSDL)
  20. ------------------------------------------------
  21.  
  22. Over the years the University of Manchester Computer Graphics Unit has 
  23. developed many novel graphics packages. However each application programmer 
  24. has had to cobble together some way of telling their application what it is 
  25. they want a picture of.
  26.  
  27. In an attempt to reduce the amount of duplicated effort the CGU research group
  28. has developed a scene description language, which allows graphics researchers
  29. to describe 3 dimensional scenes in a standard manner. Hopefully this will
  30. enable scenes to be shared amongst applications, to allow different solutions
  31. to rendering problems to be compared.
  32.  
  33. A scene designer would define a 3D scene in MSDL by preparing a text file,
  34. which describes the scene in terms of a number of objects primitives, 
  35. surface properties and lights.
  36.  
  37. The MSDL language allows polygons, triangles, spheres,cylinders, cones, 
  38. discs, boxes, NURBS and polyhedra to be used as object primitives. 
  39. Surface properties can be associated with primitives, and
  40. lights defined to enable the scene to be illuminated. In addition the user 
  41. may include an optional camera in the scene to assist users.
  42.  
  43. An application would then read the MSDL file, creating a representation of 
  44. the scene in its internal database. As MSDL is intended to be used for 
  45. research it does not prescribe an internal representation, it is assumed
  46. the application program will use an efficient storage format.
  47.  
  48. This document describes the basics of MSDL, and includes some sample pictures,
  49. generated here from MSDL files. MSDL is available by anonymous ftp, together
  50. with some scenes, documentation, and useful utilities. (See below).
  51.  
  52. A Sample MSDL scene
  53. -------------------
  54.  
  55. An extract of an MSDL file might look like :
  56.  
  57. /* An example of a complex composite */
  58.  
  59. compobj coffee_table
  60.  
  61.   /* position the whole thing where we want it in the scene */
  62.   shift 10.0 20.0 15.0
  63.  
  64.   /* The table top */
  65.   cylinder
  66.     0.0 0.0 0.0 capped 0.0 0.0 1.0 capped 1.0
  67.     scale 10.0 10.0 0.1  shift 0.0 0.0 10.0
  68.     instprops dark_wood
  69.   end
  70.  
  71.   /* The leg */
  72.   cylinder
  73.     0.0 0.0 0.0    0.0 0.0 1.0    1.0  
  74.     scale 2.0 2.0 9.8  shift 0.0 0.0 0.2
  75.     instprops  metallic_grey
  76.   end
  77.  
  78.   /* The base */
  79.   box  -2.0 -2.0 0.0    2.0 2.0 0.2
  80.     instprops  metallic_grey
  81.   end
  82.  
  83.  
  84. end    /* coffee table */
  85.  
  86. MSDL relies heavily on the concept of defined objects. The scene designer
  87. can `define' an object, and then make many instances of it in the scene. For
  88. example in the example scene of an X-terminal sat on a desk, the designer
  89. modelled a single key, and repeated it many times to form the keys on a 
  90. keyboard.
  91.  
  92. In complicated scenes this can save a great deal of time, especially if changes
  93. need to be made to the scene!
  94.  
  95. Making the programmers life easy
  96. --------------------------------
  97.  
  98. To encourage the use of MSDL at Manchester we have developed a parser. This
  99. consists of a C or C++ library which the programmer would link into her 
  100. application. Your program then calls a function
  101.  
  102. msdl(FILE *)
  103.  
  104. to begin processing a scene. The parser then loads the scene in, and processes
  105. it to determine what objects will actually appear. (This stage is where we 
  106. instance previously defined objects).
  107.  
  108. Then the parser goes through each object in the scene in turn, calling a 
  109. function to create the object in the applications database. The applications
  110. programmer provides these routines (actually all he or she does is fill in 
  111. the skeleton routines we provide). The MSDL parser passes objects, lights
  112. and surface properties in its own simple format. The application will need
  113. to copy this data into its own structures.
  114.  
  115. This makes adding MSDL reading capabilities to an existing graphics application
  116. very easy. All the user has to do is
  117.  
  118. - make the parser (libmsdl.a)
  119. - copy the skeleton routines into wherever your main app is stored, and 
  120.   rename it to something meaningful, e.g ReadMSDL.c
  121. - Fill in that file with meaningful create_* routines
  122. - Inside your application call something like
  123.   FILE *fp;
  124.   ...
  125.   fscanf(stdin, "Enter filename : %s\n", filename);
  126.   fp = fopen(filename, "r");
  127.   msdl(fp);
  128.   ..
  129.  
  130.   This parses the file and calls the skeleton routines.
  131.  
  132. - Link in your application with the parser.
  133.  
  134. Who might want to use MSDL
  135. --------------------------
  136.  
  137. MSDL was developed primarily as a tool for graphics research. We feel that 
  138. a graphics researcher trying to quickly develop a way of describing scenes to
  139. her application will find MSDL of use.
  140.  
  141. In addition users of existing systems may find the parser a useful addition
  142. to their system, as it will enable them to read existing scenes.
  143.  
  144. Example Scenes
  145. --------------
  146.  
  147. MSDL has been in use for some time at Manchester, in areas as diverse as
  148. radiosity, animation, NURBS research, physical surface models and path tracing.
  149.  
  150. Some example scenes are available at the Manchester ftp site (see below), 
  151. together with pictures of the scenes. 
  152.  
  153. Utilities
  154. ---------
  155.  
  156. Recognising that we would like to load in as many different scene formats to
  157. our applications we have begun writing file format converters. At the moment
  158. we have several OFF to MSDL converters, which are available with the 
  159. distribution. 
  160.  
  161. Further work
  162. ------------
  163.  
  164. Any scene description language intended for research will always fail to 
  165. provide everything any user could want. (We can guarantee there someone 
  166. reading this now thinking "Oh it can't do Coons-Gordon patches, its useless").
  167.  
  168. Consequently we are currently working on providing the ability to extend MSDL,
  169. by placing information in the MSDL scene which isn't interpreted by the
  170. parser, but it passed straight to the user application. By allowing this
  171. to work within MSDLs system of definition and instantiation, we ought to be
  172. able to allow a user to extend the language for his or her specific needs, 
  173. without needing to be aware of the workings of Yacc!
  174.  
  175. If you need this please email us, and we'll assign a bit more importance to 
  176. getting this done!
  177.  
  178. In addition we intend to provide converters from common scene formats to MSDL.
  179. Obviously this is an uphill struggle, and we'd welcome any converters written
  180. by you!
  181.  
  182. Availability
  183. ------------
  184.  
  185. MSDL compiles as a C or C++ library, and is built using Lex, Yacc & a compiler.
  186. It has been used primarily on HP-UX & SUN platforms, though as it can be 
  187. compiled using flex, bison and gcc we feel it could be ported to other 
  188. machines with minimal effort.
  189.  
  190. MSDL, and some example scenes to complement it, are available from the
  191. Manchester ftp site, ftp.mcc.ac.uk (130.88.200.7), in /pub/cgu/MSDL.
  192.  
  193. This distribution is supplied 'as-is'. We make no claims about its suitability
  194. for any particular use, and don't guarantee to provide support. However we
  195. all use MSDL, and would be interested in your comments and criticisms.
  196.  
  197. If you have any problems or enquiries email cgu-info@mcc.ac.uk,
  198. preferably with MSDL in the subject field!.
  199.  
  200. M. Preston (m.preston@manchester.ac.uk)
  201. N. Gatenby (gatenby@v2.cgu.mcc.ac.uk)
  202. W.T. Hewitt (hewitt@mcc.ac.uk)
  203.  
  204.  
  205.  
  206.